import { createRouter, createWebHistory } from 'vue-router'
import Home from '../views/Home.vue'
import TextAnalysis from '../views/TextAnalysis.vue'
import CodeWaterfall from '../views/CodeWaterfall.vue'
import ISReverseTools from '../views/reverse/JSReverseTools.vue'
import AndroidReverseTools from '../views/reverse/AndroidReverseTools.vue'

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    meta: { title: '首页', icon: 'home' }
  },
  {
    path: '/text-analysis',
    name: 'TextAnalysis',
    component: TextAnalysis,
    meta: { title: '文本分析', icon: 'analytics' }
  },
  {
    path: '/code-reuse',
    name: 'CodeReuse',
    component: CodeWaterfall,
    meta: { title: '代码重复使用' }
  },
  {
    path: '/reverse',
    name: 'ReverseTools',
    redirect: '/reverse/is',
    meta: { title: '逆向常用工具', icon: 'tools' },
    children: [
      {
        path: 'is',
        name: 'ISReverseTools',
        component: ISReverseTools,
        meta: { title: 'IS逆向工具' }
      },
      {
        path: 'android',
        name: 'AndroidReverseTools',
        component: AndroidReverseTools,
        meta: { title: '安卓逆向工具' }
      }
    ]
  },
  {
    path: '/download-tools',
    name: 'DownloadTools',
    component: () => import('../views/DownloadTools.vue')
  },
  {
    path: '/resume',
    name: 'Resume',
    component: () => import('../views/Resume.vue')
  },
  {
    path: '/tech-docs',
    name: 'TechDocs',
    component: () => import('../views/TechDocs.vue')
  },
  {
    path: '/tech-docs/:filename',
    name: 'MarkdownViewer',
    component: () => import('@/views/MarkdownViewer.vue')
  },
  {
    path: '/pdf-viewer/:filename',
    name: 'PdfViewer',
    component: () => import('@/views/PdfViewer.vue')
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router